<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>日程详情</title>
		<script src="../../javascript/vue.js" type="text/javascript" charset="utf-8"></script>
		<script src="../../javascript/axios.js" type="text/javascript" charset="utf-8"></script>
		<script src="../jquery.js" type="text/javascript" charset="utf-8"></script>
		<script src="../../javascript/layer/layer.js" type="text/javascript" charset="utf-8"></script>
		<link rel="stylesheet" type="text/css" href="../../javascript/layer/theme/default/layer.css"/>
	</head>
	<style type="text/css">
		*{
			margin: 0;
			padding: 0;
			font-family: "微软雅黑";
		}
		li{
   			 padding: 15px;
		}
	</style>
	<body>
		<div id="app">
			<ul v-if="ready===1">
				<li>
					<span >
						任务标题：
					</span>
					<span >
						{{tableData.title}}
					</span>
				</li>
				<li>
					<span style="margin-right: 100px;">
						开始时间：{{tableData.startTime}}
					</span>
					<span >
						结束时间：{{tableData.endTime}}
					</span>
				</li>
				<li>
					<span >
						提醒：{{tableData.oneCallTime}}
					</span>
				</li>
				<li>
					<span >
						二次提醒：{{tableData.twoCallTime}}
					</span>
				</li>
				<li>
					<span >
						处理人：{{tableData.tripName}}
					</span>
				</li>
				<li>
					<span>
						任务详情：
					</span>
					<span >
							{{tableData.content}}
					</span>
				</li>
			</ul>
		</div>
	</body>
	
	<script type="text/javascript">
		function getParam(paramName){ 
			  		paramValue =""; 
						  isFound =false; 
						  if (this.location.search.indexOf("?") ==0&&this.location.search.indexOf("=")>1){ 
						    arrSource = unescape(this.location.search).substring(1,this.location.search.length).split("&"); 
						    i =0; 
						    while (i < arrSource.length &&!isFound){ 
						      if (arrSource[i].indexOf("=") >0){ 
						        if (arrSource[i].split("=")[0].toLowerCase()==paramName.toLowerCase()){ 
						          paramValue = arrSource[i].split("=")[1]; 
						          isFound =true; 
						        } 
						      } 
						    i++; 
						    } 
						  } 
	    return paramValue;
		}		
		window.onload=function(){
//			alert(getParam('val'));
			vm.getData(getParam('val'))
		}
	
		let vm = new Vue({
			el:"#app",
			data:{
				tableData:{},
				ready:0,
				token : 'eyJhbGciOiJIUzI1NiJ9.eyJnZyI6IjQyZDRlZGQ5LWZmOTQtNDQ5Yi1hMTExLTcwMGY5YWJlNWM4MSIsImNsaWVudF9pZCI6InRlc3QiLCJ1c2VybmFtZSI6InBpZyIsInNjb3BlIjoiKiJ9._Zn4OlcKFnZlzWrflJWmkCEzqx9HBkILE7qEoEgX2Zg',
			},
			methods:{
				getData(val){
							layer.msg('加载中', {
							  icon: 16
							  ,shade: 0.01
							});
						let _this = this;
					    axios.post(developURL+richengDK+'trip/detail/'+val+'?access_token='+this.token, {
					      }).then(function (response) {
					          console.log(response)
					          console.log('selectListAll')
					          if(response.data.code==200){
					          	response.data.model.startTime = _this.dealTime(response.data.model.startTime);
					          	response.data.model.endTime = _this.dealTime(response.data.model.endTime);
					          	response.data.model.oneCallTime = _this.dealTime(response.data.model.oneCallTime);
					          	response.data.model.twoCallTime = _this.dealTime(response.data.model.twoCallTime);
					          	_this.tableData=response.data.model;
					          	_this.ready=1;
					          	layer.close(layer.index);
					          }
					      }).catch(function (error) {
					      　　	alert(error);
					      });
				},
				dealTime(date){
					let d = new Date(date);
					return d.getFullYear()+'-'+Number(d.getMonth()+1) +'-'+d.getDate()+'  '+d.getHours()+':'+d.getMinutes();
				}
			}
			
		})
	
	</script>
</html>
